﻿using Abp.Application.Services;
using FutureApp.Cms.Dto;
using System;
using Abp.Domain.Repositories;
using System.Linq;

namespace FutureApp.Cms
{
    /// <AppService/>
    public class ArticleAppService
        : AsyncCrudAppService<Article, ArticleEntityDto, Guid, GetAllArticleInput, CreateArticleInput, UpdateArticleInput, GetArticleInput, DeleteArticleInput>,
        IArticleAppService
    {
        /// <constructor/>
        public ArticleAppService(IRepository<Article, Guid> repository)
            : base(repository)
        {
        }

        /// <inheritDoc/>
        protected override IQueryable<Article> CreateFilteredQuery(GetAllArticleInput input)
        {
            return base.CreateFilteredQuery(input).Where(e => e.Group == input.Group);
        }
    }
}
